﻿<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        // Cambiare in JSON la risposta
        $(function () {
//            $.getJSON("webAPI/GetAllModels", null, function (data) {
//                alert(data.d.Models[0].LastName);
//            });

//            $.ajax({ url: "webAPI/GetAllCandidates",
//                type: "post",
//                dataType: "xml",
//                success: function (xml) {
//                    alert($(xml).find("b\\:LastName").first().text());
//                }
//            });

//            var c = new schemas.aspitalia.com.ModelVirtualCasting.Services.ModelsManager.IModelsManager();
//            c.set_path("http://ipv4.fiddler:39956/webAPI");
//            c.GetAllCandidates(null, function (r) {
//                alert(r.Models[0].LastName);
//            });

//            $.getJSON("http://www.mvc.it:39956/webAPI/GetAllModels?callback=?", null, function (data) {
//                alert(data.Models[0].LastName);
//            });
        });

        function loadJson(d) {
            alert(d.Models[0].LastName);
        }
    </script>
<%--
    <script type="text/javascript" src="webAPI/GetAllModels?callback=loadJson"></script>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server">
            <Services>
                <asp:ServiceReference Path="~/webapi" />
            </Services>
        </asp:ScriptManager>

    </div>
    </form>
</body>
</html>
